import BigNumber from "bignumber.js"

class Calculation extends BigNumber {
  //@ts-ignore
  constructor(params: BigNumber.Value) {
    super(params)
  }

  /**加 */
  //@ts-ignore
  add(params: BigNumber.Value) {
    return this.plus(params)
  }

  /**减 */
  //@ts-ignore
  cut(params: BigNumber.Value) {
    return this.minus(params)
  }

  /**乘 */
  //@ts-ignore
  multip(params: BigNumber.Value) {
    return this.times(params)
  }

  /**除 */
  //@ts-ignore
  except(params: BigNumber.Value) {
    return this.div(params)
  }
}
//@ts-ignore
function calc(params: BigNumber.Value): Calculation {
  return new Calculation(params)
}

export default calc
